home *** CD-ROM | disk | FTP | other *** search
- //----------------------------------------------------------------------------
- // cScript
- // (C) Copyright 1995, 1997 by Borland International, All Rights Reserved
- //
- // DEBUG.SPP
- // Provides support services for debugging operations.
- //
- // $Revision: 1.59 $
- //
- //----------------------------------------------------------------------------
-
- import editor;
- import IDE;
-
- import "bcwdbg.dll" {
- void SetEIPToCurrent();
- }
-
-
- // mark this module as being a library module
- library;
-
- export debugger = new Debugger();
-
- //
- // Debugger Object Handlers.
- //
-
- on debugger:>SetEIPToSelected(){
- SetEIPToCurrent();
- }
-
- on debugger:>AddBreakAtCurrent(){
- declare fileName = editor.TopBuffer.FullName;
- declare row = editor.TopBuffer.TopView.Position.Row;
- .AddBreakpointFileLine(fileName, row);
- }
-
- on debugger:>WatchCurrent(){
- if (IsEditKeyboard())
- debugger.AddWatch(editor.GetWord(), FALSE);
- }
-
- on debugger:>ModifyCurrent(){
- debugger.EvaluateWindow(editor.GetWord());
- }
-
- on debugger:>EvaluateCurrent(){
- if (IsEditKeyboard())
- debugger.EvaluateWindow(editor.GetWord());
- }
-
- on debugger:>InspectCurrent(){
- if (IsEditKeyboard()) {
- declare topView = editor.TopView;
- debugger.Inspect(editor.GetWord(), topView, topView.Position.Row,
- topView.Position.Column, FALSE);
- }
- }
-
- on debugger:>ToggleBreakpoint(declare fileName, declare row){
- if (!initialized(fileName)) {
- if (initialized(editor.TopBuffer))
- if (editor.TopBuffer != NULL)
- fileName = editor.TopBuffer.FullName;
- }
- if (!initialized(row)) {
- if (initialized(editor.TopBuffer))
- if (editor.TopBuffer != NULL)
- if (initialized(editor.TopBuffer.TopView))
- if (editor.TopBuffer.TopView != NULL )
- row = editor.TopBuffer.TopView.Position.Row;
- }
-
- pass(fileName, row);
- }
-
- on debugger:>ViewCpuFileLine(declare fileName, declare row ){
- fileName = editor.TopBuffer.FullName;
- row = editor.TopBuffer.TopView.Position.Row;
- pass(fileName, row);
- }
-
- on debugger:>RunToCurrent(){
- if (IDE.KeyboardManager.GetKeyboard() == IDE.KeyboardManager.GetKeyboard("CPU"))
- debugger.RunToAddress();
- else if (IsEditKeyboard())
- {
- declare fileName = editor.TopBuffer.FullName;
- declare row = editor.TopBuffer.TopView.Position.Row;
- debugger.RunToFileLine(fileName, row);
- }
- }
-
- //
- // IDE Object Debug Menu Debugger Handlers.
- //
-
- on IDE:>DebugAddBreakpoint(){
- if (IsEditKeyboard()) {
- debugger.AddBreakAtCurrent();
- } else {
- debugger.AddBreakpoint();
- }
- }
-
- on IDE:>DebugAddWatch(){
- if (IsEditKeyboard()) {
- debugger.AddWatch(editor.GetWord(), TRUE);
- } else {
- debugger.AddWatch();
- }
- }
-
- on IDE:>DebugAnimate(){
- debugger.Animate();
- }
-
- on IDE:>DebugProfile(){
- debugger.ViewProfile();
- // debugger.RunToFileLine( "--PROFILE--", -1 );
- }
-
- on IDE:>DebugAttach(declare Process){
- debugger.Attach(Process);
- }
-
- on IDE:>DebugBreakpointOptions(){
- debugger.BreakpointOptions();
- }
-
- on IDE:>DebugEvaluate(){
- if (IsEditKeyboard()) {
- debugger.EvaluateWindow(editor.GetWord());
- } else {
- debugger.EvaluateWindow();
- }
- }
-
- on IDE:>DebugInspect(){
- if (IsEditKeyboard()) {
- debugger.Inspect(editor.GetWord(), 0, 0, 0, TRUE);
- } else {
- debugger.Inspect("", 0, 0, 0, TRUE);
- }
- }
-
- on IDE:>DebugInstructionStepInto(){
- debugger.InstructionStepInto();
- }
-
- on IDE:>DebugInstructionStepOver(){
- debugger.InstructionStepOver();
- }
-
- on IDE:>DebugLoad(declare Process){
- debugger.Load(Process);
- }
-
- on IDE:>DebugPauseProcess(){
- debugger.PauseProgram();
- }
-
- on IDE:>DebugResetThisProcess(){
- debugger.Reset();
- }
-
- on IDE:>DebugRun() {
- debugger.Run();
- }
-
- on IDE:>DebugRunTo(){
- debugger.RunToFileLine();
- }
-
- on IDE:>DebugSourceAtExecutionPoint(){
- debugger.FindExecutionPoint();
- }
-
- on IDE:>DebugStatementStepInto(){
- debugger.StatementStepInto();
- }
-
- on IDE:>DebugStatementStepOver(){
- debugger.StatementStepOver();
- }
-
- on IDE:>DebugTerminateProcess(){
- debugger.TerminateProgram();
- }
-
- //
- // IDE Object View Menu Debugger Handlers.
- //
-
- on IDE:>ViewModule(){
- debugger.ViewModule();
- }
-
- on IDE:>ViewBreakpoint(){
- debugger.ViewBreakpoint();
- }
-
- on IDE:>ViewCallStack(){
- debugger.ViewCallStack();
- }
-
- on IDE:>ViewCpu(){
- debugger.ViewCpu();
- }
-
- on IDE:>ViewProcess(){
- debugger.ViewProcess();
- }
-
- on IDE:>ViewWatch(){
- debugger.ViewWatch();
- }
-
-
-
-
-
-